package 校测第二次模拟;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 总票数
        int total = scanner.nextInt();
        // 存储所有票
        String tickets = scanner.next();
        // 票数组
        char[] ticket = new char[total];
        if (tickets.length() % 2 == 1) {
            ticket = tickets.toCharArray();
        }
        int A = 0;
        int B = 0;
        for (char piao : ticket) {
            if (piao == 'A') {
                A++;
            } else if (piao == 'B') {
                B++;
            }
        }
        System.out.println(A > B ? "A" : "B");
    }

}
